import request from '@/utils/request'
export function list(params) {
  return request({
    url: '/admin/order/list',
    method: 'get',
    params: params
  })
}

export function last(params) {
  return request({
    url: '/admin/order/last',
    method: 'get',
    params: params
  })
}

export function save(data, params) {
  return request({
    url: '/admin/order/save',
    method: 'post',
    data: data,
    params: params
  })
}

export function calculate(data, params) {
  return request({
    url: '/admin/order/calculate',
    method: 'post',
    data: data,
    params: params
  })
}
export function del(ids) {
  return request({
    url: '/admin/order/del/' + ids,
    method: 'post'
  })
}

export function find(id) {
  return request({
    url: '/admin/order/find/' + id,
    method: 'get'
  })
}
export function update(data, params) {
  return request({
    url: '/admin/order/update',
    method: 'post',
    data: data,
    params: params
  })
}

export function cancel(id) {
  return request({
    url: '/admin/order/cancel/' + id,
    method: 'post'
  })
}

export function confirm(id) {
  return request({
    url: '/admin/order/confirm/' + id,
    method: 'post'
  })
}

export function send(id) {
  return request({
    url: '/admin/order/send/' + id,
    method: 'post'
  })
}

export function shipping(id, params, data) {
  return request({
    url: '/admin/order/shipping/' + id,
    method: 'post',
    params: params,
    data: data
  })
}

export function refunds(id) {
  return request({
    url: '/admin/order/refunds/' + id,
    method: 'post'
  })
}

export function returns(id, params, data) {
  return request({
    url: '/admin/order/returns/' + id,
    method: 'post',
    params: params,
    data: data
  })
}

export function print(id, token) {
  return request({
    url: '/admin/order/print/' + id + '?token=' + token,
    method: 'get'
  })
}

export function exportView(id, params) {
  return request({
    url: '/admin/order/export/' + id,
    method: 'get',
    params: params
  })
}

export function shippingAndAudit(id, data, params) {
  return request({
    url: '/admin/order/shippingAndAudit/' + id,
    method: 'post',
    data: data,
    params: params
  })
}

export function returnsAndAudit(id, data, params) {
  return request({
    url: '/admin/order/returnsAndAudit/' + id,
    method: 'post',
    data: data,
    params: params
  })
}

export function calculateEstimateDate(params) {
  return request({
    url:'/admin/order/calculateEstimateDate',
    method:'post',
    params: params
  })
}

export function pause(params) {
  return request({
    url:'/admin/order/pause',
    method:'post',
    params: params
  })
}

export function updateWeekAndReceiver(params) {
  return request({
    url:'/admin/order/updateWeekAndReceiver',
    method:'post',
    params: params
  })
}

export function getHistoryList(params) {
  return request({
    url:'/admin/order/getHistoryList',
    method:'post',
    params: params
  })
}
export function complete(params) {
  return request({
    url:'/admin/order/complete',
    method:'post',
    params:params
  })
}

